package com.atguigu;

import com.atguigu.dyn.ProxyFactory;
import com.atguigu.statics.StaticProxyCalculator;

public class UseAop {
    public static void main(String[] args) {
        Calculator calculator = new CalculatorPureImpl();
        Calculator proxy = new StaticProxyCalculator(calculator);
        int add = proxy.add(1,1);
        System.out.println("add = " + add);
        ProxyFactory factory = new ProxyFactory(calculator);
        Calculator proxy1 = (Calculator) factory.getProxy();
        proxy1.add(1,1);
    }
}
